@extends("admin.frame_layout")
<?php $top_selected = "系统设置";$page_menu = "系统日志" ?>
@section('content')
    <div class="rightinfo">
        {{--搜索条件--}}
        <div class="tools">
            <form method="get" id="sform" action="{{route('admin.logs')}}">
                <ul class="toolbar">
                    <li>
                        <select id="search_type" name="search_type">
                            <option value="1">按管理员筛选</option>
                            <option value="2">按操作IP筛选</option>
                            <option value="3" class="module">按模块筛选</option>

                        </select>
                    </li>

                    <li id="search_1">
                        <input id="search_str" name="search_str_1" type="text" placeholder="搜索条件">
                    </li>
                    <li id="search_2" style="display:none;">
                        <select   name="search_str_2">
                            <option value="1">工作台模块下操作</option>
                            <option value="2">会员管理模块下操作</option>
                            <option value="3">信息管理模块下操作</option>
                            <option value="4">碎片管理模块下操作</option>
                            <option value="5">模式管理模块下操作</option>
                            <option value="6">系统设置模块下操作</option>
                        </select>
                    </li>
                    <li>
                        <a href="javascript:void(0)" onclick="$('#sform').submit()">
                            <span><img src="{{asset('admin/imgs/ico06.png')}}" width="20px"
                                       height="20px"/></span>搜索
                        </a>
                    </li>
                </ul>
            </form>
        </div>

        <table class="tablelist">
            <thead>
            <tr>
                <th width="70px">操作</th>
                <th width="100px">编号<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th width="120px">管理员</th>
                <th width="150px">操作时间</th>
                <th style="text-align: left;">操作记录</th>
                <th width="150px">操作IP</th>
            </tr>
            </thead>
            <tbody>
            @foreach($logs as $log)
                <tr>
                    <td class="act" bind="#{{$log->id}}">
                        <img src="{{asset('admin/imgs/t05.png')}}"/>菜单
                        <ul id="{{$log->id}}">
                            @if(ss('admin_super') == 1)
                                <li onclick="openOkDlg('{{route('admin.logs.del',['id'=>$log->id])}}')">
                                    <img with="10000px" src="{{asset('admin/imgs/d02.png')}}"/>删除
                                </li>
                            @else
                                <li>
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>日志不可操作
                                </li>
                            @endif

                        </ul>
                    </td>
                    <td>{{$log->id}}</td>
                    <td>{{$log->username}}</td>
                    <td>{{date("Y-m-d H:i",$log->time)}}</td>
                    <td class="text-left">{{$log->intro}}</td>
                    <td>{{$log->ip}}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
        @include('admin.coms.fenye')
    </div>

    @include('admin.coms.dialog')
@endsection
@section('footer')
    <script type="text/javascript">
        $(document).ready(function () {
            //初始化表格操作菜单
            $('.tablelist tbody tr:odd').addClass('odd');
            $(".tablelist .act").hover(function () {
                $($(this).attr("bind")).show();
            }, function () {
                $($(this).attr("bind")).hide();
            });


        });

        $("#search_type").change(function () {
            let mm = $("#search_type").val();
            if (mm == 3) {
                $("#search_1").hide();
                $("#search_2").show();
            }else{
                $("#search_2").hide();
                $("#search_1").show();
            }
        });

    </script>
@endsection

